import { http } from '@/utils'
import { getToken } from '@/utils'
export const getUserInfo = () => {
  return async (dispatch, getState) => {
    const { login: token } = getState()


    const res = await http.get('/user/profile', {
      headers: {
        Authorization: 'Bearer ' + token
      }
    })
    dispatch({ type: 'user/getInfo', payload: res.data.data })

  }
}
